package com.taobao.api.request;

import java.util.Date;
import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.TaobaoRequest;
import com.taobao.api.internal.util.RequestCheckUtils;
import com.taobao.api.internal.util.TaobaoHashMap;
import com.taobao.api.response.HanoiGroupUpdatePapResponse;

/**
 * TOP API: taobao.hanoi.group.update.pap request
 * 
 * @author auto create
 * @since 1.0, 2013-08-03 16:51:00
 */
public class HanoiGroupUpdatePapRequest implements TaobaoRequest<HanoiGroupUpdatePapResponse> {

  private Map<String, String> headerMap = new TaobaoHashMap();
  private TaobaoHashMap       udfParams;                      // add
                                                              // user-defined
                                                              // text parameters
  private Long                timestamp;

  /**
   * 认证信息
   */
  private String              appName;

  /**
   * 分组的描述
   */
  private String              description;

  /**
   * 分组上次更新时间
   */
  private Date                gmtModified;

  /**
   * 分组的编码
   */
  private String              groupCode;

  /**
   * 需要更新的分组id
   */
  private Long                id;

  /**
   * 分组的名称
   */
  private String              name;

  /**
   * 开放策略（true 开放，默认为false）
   */
  private Boolean             open;

  /**
   * 使用场景
   */
  private Long                scene;

  /**
   * 分组的类型，0 互斥，1 共存，默认为0
   */
  private Long                type;

  public void setAppName(String appName) {
    this.appName = appName;
  }

  public String getAppName() {
    return this.appName;
  }

  public void setDescription(String description) {
    this.description = description;
  }

  public String getDescription() {
    return this.description;
  }

  public void setGmtModified(Date gmtModified) {
    this.gmtModified = gmtModified;
  }

  public Date getGmtModified() {
    return this.gmtModified;
  }

  public void setGroupCode(String groupCode) {
    this.groupCode = groupCode;
  }

  public String getGroupCode() {
    return this.groupCode;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Long getId() {
    return this.id;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getName() {
    return this.name;
  }

  public void setOpen(Boolean open) {
    this.open = open;
  }

  public Boolean getOpen() {
    return this.open;
  }

  public void setScene(Long scene) {
    this.scene = scene;
  }

  public Long getScene() {
    return this.scene;
  }

  public void setType(Long type) {
    this.type = type;
  }

  public Long getType() {
    return this.type;
  }

  public Long getTimestamp() {
    return this.timestamp;
  }

  public void setTimestamp(Long timestamp) {
    this.timestamp = timestamp;
  }

  public String getApiMethodName() {
    return "taobao.hanoi.group.update.pap";
  }

  public Map<String, String> getTextParams() {
    TaobaoHashMap txtParams = new TaobaoHashMap();
    txtParams.put("app_name", this.appName);
    txtParams.put("description", this.description);
    txtParams.put("gmt_modified", this.gmtModified);
    txtParams.put("group_code", this.groupCode);
    txtParams.put("id", this.id);
    txtParams.put("name", this.name);
    txtParams.put("open", this.open);
    txtParams.put("scene", this.scene);
    txtParams.put("type", this.type);
    if (this.udfParams != null) {
      txtParams.putAll(this.udfParams);
    }
    return txtParams;
  }

  public void putOtherTextParam(String key, String value) {
    if (this.udfParams == null) {
      this.udfParams = new TaobaoHashMap();
    }
    this.udfParams.put(key, value);
  }

  public Class<HanoiGroupUpdatePapResponse> getResponseClass() {
    return HanoiGroupUpdatePapResponse.class;
  }

  public void check() throws ApiRuleException {
    RequestCheckUtils.checkNotEmpty(appName, "appName");
    RequestCheckUtils.checkNotEmpty(gmtModified, "gmtModified");
    RequestCheckUtils.checkNotEmpty(id, "id");
  }

  public Map<String, String> getHeaderMap() {
    return headerMap;
  }
}
